The invention relates to a method for producing a time base for a microcontroller and a simple circuit arrangement therefor.
In DE 102 60 244 A1 a method for time measurement in an electronic device is disclosed, incorporating a timer component with an RC-oscillator is disclosed. A capacitor of an RC-element is charged and discharged via a resistance of the RC-element. The voltage at the capacitor describes an exponential charging and discharge curve. On reaching a threshold voltage the timer component switches an output into the opposite state (HIGH or LOW), so that a square wave voltage is produced at the output, the frequency of which is specified by the values of the RC-element. As this frequency is too inaccurate to be used as a time base, a correction figure is determined, with the aid of which a corrected time base is calculated. For this purpose the electronic device additionally incorporates a microcontroller with a quarts or ceramic oscillator unit, which generates a second frequency with better stability than the timer component, but is only operative temporarily, in order to save power. The correction figure is determined by comparing the two frequencies from time to time.
Many microcontrollers with an external quartz or resonator require appropriate installation space, or can be particularly expensive if their dimensions are small. There are also microcontrollers that have an internal RC-oscillator, and therefore rather small dimensions. In many microcontrollers, the clock frequency is dependent on the operating voltage and the temperature, and can therefore vary by over +/− 30%. Moreover, the current consumption of these microcontrollers can be considered too nigh for use in battery-operated devices.